/**
 * @file    SimplexNoise.h
 * @brief   A Perlin Simplex Noise C++ Implementation (1D, 2D, 3D).
 *
 * Copyright (c) 2014-2018 Sebastien Rombauts (sebastien.rombauts@gmail.com)
 *
 * Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt
 * or copy at http://opensource.org/licenses/MIT)
 */

#ifndef _SIMPLEX_NOISE_INT_H_
#define _SIMPLEX_NOISE_INT_H_

#include <stddef.h>  // size_t
#include <stdint.h>

#ifdef __cplusplus
extern "C" {
#endif

/**
 * @brief A Perlin Simplex Noise C++ Implementation (1D, 2D, 3D, 4D).
 */
struct SimplexNoise_Int_t {
//public:


//private:
    // Parameters of Fractional Brownian Motion (fBm) : sum of N "octaves" of noise
    float mFrequency;   ///< Frequency ("width") of the first octave of noise (default to 1.0)
    float mAmplitude;   ///< Amplitude ("height") of the first octave of noise (default to 1.0)
    float mLacunarity;  ///< Lacunarity specifies the frequency multiplier between successive octaves (default to 2.0).
    float mPersistence; ///< Persistence is the loss of amplitude between successive octaves (usually 1/lacunarity)
};

/**
 * Constructor of to initialize a fractal noise summation
 *
 * @param[in] frequency    Frequency ("width") of the first octave of noise (default to 1.0)
 * @param[in] amplitude    Amplitude ("height") of the first octave of noise (default to 1.0)
 * @param[in] lacunarity   Lacunarity specifies the frequency multiplier between successive octaves (default to 2.0).
 * @param[in] persistence  Persistence is the loss of amplitude between successive octaves (usually 1/lacunarity)
 */
extern void SimplexNoise_Int_Init(struct SimplexNoise_Int_t* const noise, float frequency, float amplitude, float lacunarity, float persistence);

// 1D Perlin simplex noise
//static float noise(float x);
// 2D Perlin simplex noise
//static float noise(float x, float y);
// 3D Perlin simplex noise
//static float noise(float x, float y, float z);

// Fractal/Fractional Brownian Motion (fBm) noise summation
extern float SimplexNoise_Int_fractal(struct SimplexNoise_Int_t* const noise, size_t octaves, float x);
extern float SimplexNoise_Int_fractal2d(struct SimplexNoise_Int_t* const noise, size_t octaves, float x, float y);
extern float SimplexNoise_Int_fractal3d(struct SimplexNoise_Int_t* const noise, size_t octaves, float x, float y, float z);

#ifdef __cplusplus
}
#endif

#endif  // _SIMPLEX_NOISE_INT_H_
